-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[CIR][NFC] Add example for get_bitfield with volatile qualifier #147828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clangir Author: None (Andres-Salamanca) ChangesThe example demonstrates how Full diff: https://github.com/llvm/llvm-project/pull/147828.diff 1 Files Affected:
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index 6529f1386599c..8041630112ab5 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -1685,6 +1685,9 @@ def GetBitfieldOp : CIR_Op<"get_bitfield"> {
A unit attribute `volatile` can be used to indicate a volatile load of the
bitfield.
+ ```mlir
+ cir.get_bitfield(#bfi, %0 {is_volatile} : !cir.ptr<!u64i>) -> !s32i
+ ```
Example:
Suppose we have a struct with multiple bitfields stored in
|
@llvm/pr-subscribers-clang Author: None (Andres-Salamanca) ChangesThe example demonstrates how Full diff: https://github.com/llvm/llvm-project/pull/147828.diff 1 Files Affected:
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index 6529f1386599c..8041630112ab5 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -1685,6 +1685,9 @@ def GetBitfieldOp : CIR_Op<"get_bitfield"> {
A unit attribute `volatile` can be used to indicate a volatile load of the
bitfield.
+ ```mlir
+ cir.get_bitfield(#bfi, %0 {is_volatile} : !cir.ptr<!u64i>) -> !s32i
+ ```
Example:
Suppose we have a struct with multiple bitfields stored in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
f6338bb
to
e125ad4
Compare
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/23254 Here is the relevant piece of the build log for the reference
|
The example demonstrates how
get_bitfield
is emitted when accessing a bitfield declared asvolatile
.